POV-Ray : Newsgroups : povray.advanced-users : Numerical Precision : Re: Numerical Precision Server Time
4 Oct 2024 19:22:01 EDT (-0400)
  Re: Numerical Precision  
From: Penelope20k
Date: 12 Sep 2007 04:06:07
Message: <46e79def@news.povray.org>
well need to calculate A/B

well the units are:                         The rest of
C0 = int (A/B)           ....................  R0 = A - C0 * B

the first decimal is

C1 = int ( (A - B * C0 ) *10 / B )   .........  C1 = int ( R0*10 / B)
.............  R1 = R0*10 - C1*B

C2 = int ( R1 * 10 /  B )


Cn= int ( 10 * R(n-1) / B) .................... Rn = 10*R(n-1) - Cn*B




Exemple: 7 / 11

C0 = 0    R0 = 7
C1 = int (70/11)   = 6           R1= 70-6*11 = 4
C2 = int (40/11) =  3            R2 = 7
C3 = 70/11 = 6                 R3 = 4
C4 = 40/11 = 3                R4 = 7

etc ...  with a loop willbe easy




so 7 / 11   =   0.6309




hope this will help you ....












web.46e41787bca8f08494e61a50@news.povray.org...
> Does anybody know of a way, short of modifying the sourcecode, to increase
> the numerical precision that pov ray uses.
>
> For example say I need to calculate 1/3 to the 100th decimal place. I
> believe it goes upto maybe the 8th or sixteenth place?
>
> Is there some ini option that can do this?
>
> What about declaring the value as you want it.
> i.e. instead of writing
> #declcare my_var = 1/3;
>
> declare it as
> #declare my_var = 0.333333333333333333333333333333333333333333333333333;
>
> Would this do anything or would it truncate after a certain decimal spot?
>
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.